package cn.sciento.farm.devicemanager.gateway.model.downlink;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class MqttContent {
    public MqttContent() {
        header = new HashMap<>();
    }

    public MqttContent(String topic, String payload) {
        this();
        this.topic = topic;
        this.payload = payload;
    }

    private String topic;

    private String topicPrefix = "";

    private String payload;

    private Map<String, Object> header;

    public MqttContent setHeader(String key,Object value){
        header.putIfAbsent(key,value);
        return this;
    }

}

